<ol class="breadcrumb">
  <li><a href="<?php echo $this->webroot;?>">Home</a><span class="divider">/</span></li>
  <li><a href="<?php echo $this->webroot;?>Plan/index">Piani di Lavoro</a><span class="divider">/</span></li>
  <li class="active">Lista Dettaglio</li>
</ol>
<div class="row-fluid">
    <h2>Piano di Lavoro del Prof. <?php echo $this->Session->read("ProfiloDocente.User.username"); ?><br><small><i class="icon-time"></i> ultimo accesso: 29/09/2013 - 13:30</small></h2>
    <table class="table table-bordered table-hover table-striped">
      <thead>
        <tr>
          <th>#</th>
          <th>Titolo</th>
          <th>Data Previsione Svolgimento</th>
          <th>Data Svolgimento</th>
          <th>Motivazione ritardo</th>
          <th>Data inserimento</th>
          <th></th>
          <th></th>
          <th></th>
        </tr>
      </thead>
      <tfoot>
        <?php if($plan['Plan']['lock']==0){ ?>
        <tr>
          <th colspan="9" align="right" style="text-align: right;"><a href="<?php echo $this->webroot;?>Plan/add/<?php echo $plan["Plan"]["id"]?>"><i class="icon-plus"></i> Aggiungi Dettaglio</a></th>
        </tr>
        <?php }?>
      </tfoot>
      <tbody>
        <?php foreach($plan["PlanDetail"] as $planDetail){?>
        <tr class="<?php echo $planDetail["data_svolgimento"]!=null?'success':''?>">
          <td><?php echo $planDetail["id"]?></td>
          <td><?php echo $planDetail["titolo"]?></td>
          <td><?php echo $planDetail["data_previsione"]?></td>
          <td><?php echo $planDetail["data_svolgimento"]?></td>
          <td><?php echo $planDetail["motivazione_posticipo"]?></td>
          <td><?php echo $planDetail["dt_ins"]?></td>
          <td><?php echo $planDetail["data_svolgimento"]!=null?"<i class='icon-ok-sign'></i> svolto":'da svolgere';  ?></td>
            <?php  if($planDetail["data_svolgimento"]==null && $plan['Plan']['lock']==0){?>  
                <td><a href="<?php echo $this->webroot;?>Plan/remove/<?php echo $planDetail["id"];?>">Elimina</a></td>
            <?php }else{?>
                <td>Elimina</td>
            <?php }?>
            <?php  if($planDetail["data_svolgimento"]==null && $plan['Plan']['lock']==0){?>  
                <td><a href="<?php echo $this->webroot;?>Plan/edit/<?php echo $planDetail["id"];?>">Modifica</a></td>
            <?php }else{?>
                <td><a href="<?php echo $this->webroot;?>Plan/edit/<?php echo $planDetail["id"];?>">Visualizza</a></td>
            <?php }?>
        </tr>
        <?php }?>
      </tbody>
    </table>  
    </div>
</div>
        